<template>
  <div class="app-container" style="text-align: center" v-loading="loading">
    <h1>
      所有餐馆人均消费
    </h1>
    <h3 style="font-weight: bolder;font-size: 28px">
      <count-to :startVal='0' :useEasing="true" :endVal='40.5' :duration='2000'></count-to>
      元
    </h3>

  </div>
</template>

<script>
import countTo from 'vue-count-to';
import request from "@/utils/request";

export default {
  name: "index",
  components: {countTo},
  data() {
    return {
      number: 0.0,
      loading: false
    }
  },
  created() {

    this.init()
  },

  methods: {
    init() {
      request({
        url: '/data/allConsumption',
        method: 'GET',
      }).then(v => {
        this.loading = false
        this.number = v.data
      })
    }
  }
}
</script>

<style scoped>

</style>
